﻿@model IEnumerable<Mvc5Ef6WebApiDataFirstNthW.Models.Product>

@using PagedList.Mvc;

@{
    ViewBag.Title = "Products";
    ViewBag.Description = "List of the products";
}
@section PrintToPdf
{
    @Html.ActionLink("PDF", ViewContext.RouteData.GetRequiredString("action") + "ToPdf", ViewContext.RouteData.GetRequiredString("controller"), null, new { @class = "pdfMenu" })
}


@*To insert message in PRINT AND PDF*@
<header></header>

<h2>@ViewBag.Title</h2>
<div class="table-responsive">
    <table class="table table-striped table-bordered table-hover table-condensed">
        <thead>
            <tr>
                <th>
                    @Html.DisplayNameFor(model => model.ProductName)
                </th>
                <th>
                    @Html.DisplayNameFor(model => model.QuantityPerUnit)
                </th>
                <th>
                    @Html.DisplayNameFor(model => model.UnitPrice)
                </th>
                <th>
                    @Html.DisplayNameFor(model => model.UnitsInStock)
                </th>
                <th>
                    @Html.DisplayNameFor(model => model.UnitsOnOrder)
                </th>
                <th>
                    @Html.DisplayNameFor(model => model.ReorderLevel)
                </th>
                <th>
                    @Html.DisplayNameFor(model => model.Discontinued)
                </th>
                <th>
                    @Html.DisplayNameFor(model => model.Category.CategoryName)
                </th>
                <th>
                    @Html.DisplayNameFor(model => model.Supplier.CompanyName)
                </th>
            </tr>
        </thead>
        <tbody>
            @foreach (var item in Model)
            {
                <tr>
                    <td>
                        @Html.DisplayFor(modelItem => item.ProductName)
                    </td>
                    <td>
                        @Html.DisplayFor(modelItem => item.QuantityPerUnit)
                    </td>
                    <td>
                        @Html.DisplayFor(modelItem => item.UnitPrice)
                    </td>
                    <td>
                        @Html.DisplayFor(modelItem => item.UnitsInStock)
                    </td>
                    <td>
                        @Html.DisplayFor(modelItem => item.UnitsOnOrder)
                    </td>
                    <td>
                        @Html.DisplayFor(modelItem => item.ReorderLevel)
                    </td>
                    <td>
                        @Html.DisplayFor(modelItem => item.Discontinued)
                    </td>
                    <td>
                        @Html.DisplayFor(modelItem => item.Category.CategoryName)
                    </td>
                    <td>
                        @Html.DisplayFor(modelItem => item.Supplier.CompanyName)
                    </td>
                </tr>
            }
        </tbody>
    </table>
</div>
